B-1.1, r. 2 - Construction Code

Full text
8.80. A joint at the point of connection of underground piping with a tank must be a swing joint or have an underground flexible connection, unless the piping is vertical at its point of connection to the tank over its entire length.
In addition, a swing joint or flexible connection must be connected at the base of each dispenser, at the connection of a submersible pump and the vertical portion of the vent.
Despite the foregoing, a swing joint is not required if the piping is flexible.
O.C. 220-2007, s. 1.